Skip to content

fix(rt-data): handle singleton-array projection traversal#976

Draft
Stevengre wants to merge 2 commits intomasterfrom
codex/upstream/issue-021-singleton-array-projection
Draft

fix(rt-data): handle singleton-array projection traversal#976
Stevengre wants to merge 2 commits intomasterfrom
codex/upstream/issue-021-singleton-array-projection

Conversation

@Stevengre
Copy link
Contributor

@Stevengre Stevengre commented Mar 6, 2026

Summary

This adds singleton-array runtime projection support in rt/data.md and a minimal prove-rs reproducer for pointer-cast writes through *mut [u8; 1].

Context

The runtime already had type/projection plumbing for projectionElemSingletonArray, but write paths still had no #traverseProjection rule for that projection. When a pointer is cast to a singleton array pointer and then written through, execution reaches #traverseProjection(..., projectionElemSingletonArray ...) and stops.

Red vs Green

Red:

  • singleton-array-pointer-cast-fail.rs got stuck at #traverseProjection(..., projectionElemSingletonArray .ProjectionElems, .Contexts).
  • The same family shows up downstream in close_account_multisig through std::ptr::write_volatile::<[u8; 32]>.

Green:

  • #traverseProjection wraps the value in a singleton array context.
  • #buildUpdate unwraps that singleton array on the way back out.
  • #projectionsFor reconstructs the projection path correctly, so the reproducer now runs as the passing fixture singleton-array-pointer-cast.rs and reaches #EndProgram instead of stopping at projection traversal.

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant